﻿using System;
using System.Collections.Generic;
using Autodesk.Revit.DB;

namespace YArchitech.HVAC.AuxiliaryCurve
{
	public class DisPointsGet : AuxiliaryPointsGet
	{
		public DisPointsGet(XYZ minArgu, XYZ maxArgu, double xDisArgu, double yDisArgu, ref Dictionary<XYZ, XYZ> dicxArgu, ref Dictionary<XYZ, XYZ> dicYArgu) : base(ref dicxArgu, ref dicYArgu)
		{
			this.min = minArgu;
			this.max = maxArgu;
			this.xDis = xDisArgu;
			this.yDis = yDisArgu;
		}

		public override bool GetPoints()
		{
			double num = this.min.X;
			double num2 = this.max.Y;
			if (this.yDis > 0.0)
			{
				do
				{
					XYZ key = new XYZ(num, this.min.Y, 0.0);
					XYZ value = new XYZ(num, this.max.Y, 0.0);
					this.dicY.Add(key, value);
					num += this.yDis;
				}
				while (num < this.max.X);
			}
			if (this.xDis > 0.0)
			{
				do
				{
					XYZ key2 = new XYZ(this.min.X, num2, 0.0);
					XYZ value2 = new XYZ(this.max.X, num2, 0.0);
					this.dicX.Add(key2, value2);
					num2 -= this.xDis;
				}
				while (num2 > this.min.Y);
			}
			return true;
		}

		protected XYZ min;

		protected XYZ max;

		protected double xDis;

		protected double yDis;
	}
}
